package com.example.demo.GlobalException;

/**
 * 状态码枚举类
 * @author mrc
 */

public enum CommonEnum implements BaseErrorInfoInterface {
    // 数据操作错误定义
    SUCCESS(200, "成功!"),
    BODY_NOT_MATCH(400,"请求的数据不符!"),
    LOGIN_TIME_OUT(401,"登录失效！"),
    FORBIDDEN(403,"没有权限，不允许访问！"),
    NOT_FOUND(404, "未找到该资源!"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误!"),
    SERVER_BUSY(503,"服务器正忙，请稍后再试!")
    ;

    /** 错误码 */
    private Integer resultCode;

    /** 错误描述 */
    private String resultMsg;

    /**
     * 错误码
     */
    @Override
    public Integer getResultCode() {
        return resultCode;
    }

    /**
     * 错误描述
     */
    @Override
    public String getResultMsg() {
        return resultMsg;
    }

    CommonEnum(Integer resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }
}
